/**
 * Copyright (c) 2018-2028, Joffee.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sailmi.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sailmi.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Objects;

/**
 * 实体类
 *
 * @author Joffee
 */

@TableName("ucs_tenant")

@Schema(name = "Tenant对象", description = "Tenant对象")
public class Tenant extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键id
	 */
	@Schema(name = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 租户ID
	 */
	@Schema(name = "租户ID")
	private String tenantId;

	/**
	 * 租户所属企业ID
	 * 当建立租户的时候，应先建立相应的管理企业，企业是具体业务的实体。
	 * 租户管理企业的所属租户为平台根租户。
	 */
	@Schema(name = "租户所属企业ID")
	private Long enterpriseId;

	/**
	 * 租户名称
	 */
	@Schema(name = "租户名称")
	private String tenantName;
	/**
	 * 联系人
	 */
	@Schema(name = "联系人")
	private String linkman;
	/**
	 * 联系电话
	 */
	@Schema(name = "联系电话")
	private String contactNumber;
	/**
	 * 联系地址
	 */
	@Schema(name = "联系地址")
	private String address;

	/**
	 * 是否已删除
	 */
	@TableLogic
	@Schema(name = "是否已删除")
	private Integer isDeleted;

	/**
	 * 租 户状态
	 */
	@Schema(name = "租户状态")
	private Integer status;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTenantId() {
		return tenantId;
	}

	public void setTenantId(String tenantId) {
		this.tenantId = tenantId;
	}

	public Long getEnterpriseId() {
		return enterpriseId;
	}

	public void setEnterpriseId(Long enterpriseId) {
		this.enterpriseId = enterpriseId;
	}

	public String getTenantName() {
		return tenantName;
	}

	public void setTenantName(String tenantName) {
		this.tenantName = tenantName;
	}

	public String getLinkman() {
		return linkman;
	}

	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	public String getContactNumber() {
		return contactNumber;
	}

	public void setContactNumber(String contactNumber) {
		this.contactNumber = contactNumber;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public Integer getIsDeleted() {
		return isDeleted;
	}

	@Override
	public void setIsDeleted(Integer isDeleted) {
		this.isDeleted = isDeleted;
	}

	@Override
	public Integer getStatus() {
		return status;
	}

	@Override
	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof Tenant tenant)) return false;
		return Objects.equals(id, tenant.id) && Objects.equals(tenantId, tenant.tenantId) && Objects.equals(enterpriseId, tenant.enterpriseId) && Objects.equals(tenantName, tenant.tenantName) && Objects.equals(linkman, tenant.linkman) && Objects.equals(contactNumber, tenant.contactNumber) && Objects.equals(address, tenant.address) && Objects.equals(isDeleted, tenant.isDeleted) && Objects.equals(status, tenant.status);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id, tenantId, enterpriseId, tenantName, linkman, contactNumber, address, isDeleted, status);
	}
}
